<%@page import="JavaServlet.TimeServlet.Student"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="bootstrap-3.3.7-dist/css/bootstrap.css"/>
</head>
<body>
	<form action="${pageContext.request.contextPath }/student?method=searchName" method="post">
		名字：<input type="text" name="searchName"/>
		<input type="submit" value="搜索"/>
	</form>
	<a href="/JavaWeb190703/student?method=chooseBanji" class="btn btn-success">添加</a>
	<%-- ${list} --%>
	<table class="table table-striped table-bordered table-hover table-condensed">
		<tr>
			<td>ID</td>
			<td>姓名</td>
			<td>年龄</td>
			<td>性别</td>
			<td>删除</td>
			<td>修改</td>
		</tr>
		<c:forEach items="${list}" var="student">	
			<tr>
				<td>${student.id}</td>
				<td>${student.name}</td>
				<td>${student.age}</td>
				<td>${student.gender}</td>
<%-- 				<td><a href="/JavaWeb190703/studentDelete?id=<%=student.getId()%>">删除</a></td> --%>
				<td><a href="javascript:void(0)" onclick="deleteById(${student.id})">删除</a></td>
				<td><a href="${pageContext.request.contextPath}/student?method=toUpdate&id=${student.id}">修改</a></td>
			</tr>
		</c:forEach>
	</table>
	<script type="text/javascript">
		function deleteById(id){
			var isDel = confirm("您确定要删除吗")
			if(isDel){
				location.href="/JavaWeb190703/student?method=deleteById&id=" + id;
			}
		}
	</script>
	<%-- <%
		ArrayList<Student>list = new ArrayList<Student>();
		Student student1 = new Student(1, "張三1", 23, "男");		
		Student student2 = new Student(2, "張三2", 23, "男");		
		Student student3 = new Student(3, "張三3", 23, "男");		
		Student student4 = new Student(4, "張三4", 23, "男");		
		Student student5 = new Student(5, "張三5", 23, "男");	
		list.add(student1);
		list.add(student2);
		list.add(student3);
		list.add(student4);
		list.add(student5);
		
		 
	%>
	
	<%
		for(int i = 1; i <= 6; i++){
	%>
			<h<%=i%>>标题<%=i%></h<%=i %>>
	
	<% 
		}
	%>
	<%
	for(int i = 1; i <= 9; i++){
		for(int j = 1; j <= i; j++){
	%>
			<%=j %>*<%=i %>=<%=i*j %>&nbsp;&nbsp;
	<%
		}
	%>
	<br>
	<%
	}
	 %> --%>
</body>
</html>